<script>
	import {
		log
	} from "console"
	import login from './api/login'
	const baseUrl='http://192.168.50.168'
	export default {
		onLaunch: function() {
			console.log('App Launch')

		},
		onShow: function() {
			console.log('App Show')
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style>
	/*每个页面公共css */
	@import "colorui/main.css";
	@import "colorui/icon.css";
	@import "colorui/animation.css";
</style>


<!-- 
 
 uni.request({
 	url: baseUrl+'/schoolET/wx/login?code='+res.code, //仅为示例，并非真实接口地址。
 	data:{code:res.code},
 	method:"POST",
 	success: (res) => {
 		console.log(res)
 		const detail=res.data.data
 		if (detail.flag) {
 			uni.setStorageSync('token', detail.token);
 		} else{
 			 wx.showToast({  
 			    title: res.data.msg,  
 			    icon: 'success', // 可以是 'success'、'loading'、'none'  
 			    duration: 2000 // 持续时间，单位毫秒，默认1500  
 			  }) 
 			  wx.showModal({  
 			    title: '加入区域',  
 			    editable: true, // 设置为true，显示输入框  
 			    placeholderText: '请输入区域码', // 输入框占位符  
 			    success: function(res) { 
 			      if (res.confirm) {  
 					  uni.request({
 					  	url:baseUrl+'/schoolET/wx/invitation/'+res.content,
 						method:'GET',
 						success(res) {
 							console.log(res)
 							wx.showToast({  
 							   title: res.data.msg,  
 							   icon: 'success', // 可以是 'success'、'loading'、'none'  
 							   duration: 2000 // 持续时间，单位毫秒，默认1500  
 							 }) 
 						}
 					  })
 			      } else if (res.cancel) {  
 			        console.log('用户点击了取消');  
 			      }  
 			    }  
 			  });
 		}
 		// uni.setStorageSync('token', res.data.data.token);
 		// console.log("登陆成功")
 	}
 })
 
 -->